/*
 * @Author: your name
 * @Date: 2021-09-21 22:18:00
 * @LastEditTime: 2022-02-13 17:05:21
 * @LastEditors: ke.xue
 * @Description: In User Settings Edit
 * @FilePath: \product-display\src\router\routes.js
 */

const RouteView = {
  name: 'RouteView',
  render: h => h('router-view')
}

export const operate = {
  path: '/operate',
  name: 'operate',
  menu: true,
  component: RouteView,
  redirect: '/operate/login',
  meta: { title: '商品管理' },
  children: [
    {
      path: '/operate/type',
      name: 'operateType',
      menu: true,
      redirect: '/operate/type/list',
      meta: { title: '分类列表' },
      component: require('@/components/layout/product').default,
      children: [
        {
          path: '/operate/type/list',
          name: 'operateTypeList',
          component: require('@/page/operate/type/list.vue').default,
          meta: { title: '分类' }
        }, {
          path: '/operate/type/form',
          name: 'operateTypeForm',
          component: require('@/page/operate/type/form.vue').default,
          meta: { title: '分类' }
        }
      ]
    }, {
      path: '/operate/product',
      name: 'operateProduct',
      menu: true,
      redirect: '/operate/product/list',
      meta: { title: '商品列表' },
      component: require('@/components/layout/product').default,
      children: [
        {
          path: '/operate/product/list',
          name: 'operateProductList',
          component: require('@/page/operate/product/list.vue').default,
          meta: { title: '商品' }
        }, {
          path: '/operate/product/form',
          name: 'operateProductForm',
          component: require('@/page/operate/product/form.vue').default,
          meta: { title: '商品' }
        }
      ]
    }
  ]
}

export const routes = [
  {
    path: '/',
    name: 'main',
    redirect: '/show/index'
  }, {
    path: '/show',
    name: 'Show',
    component: require('@/components/layout/show.vue').default,
    redirect: '/show/index',
    children: [
      {
        path: '/show/index',
        name: 'index',
        title: '网站首页',
        component: require('@/page/show/index.vue').default
      },
      {
        path: '/show/detail',
        name: 'showDetail',
        title: '商品详情',
        component: require('@/page/show/detail.vue').default
      },
      {
        path: '/show/list',
        name: 'showList',
        title: '产品中心',
        component: require('@/page/show/list.vue').default
      },
      {
        path: '/show/about',
        name: 'about',
        title: '关于我们',
        component: require('@/page/show/about.vue').default
      }
    ]
  }, operate, {
    path: '/operate/login',
    name: 'operateLogin',
    component: require('@/page/operate/login.vue').default
  }
]
